#ifndef BASICHTTPAPI_H
#define BASICHTTPAPI_H

#include <QSettings>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#include <QObject>

class BasicHttpAPI : public QObject
{
    Q_OBJECT
public:
    explicit BasicHttpAPI(QObject *parent = 0);
    void get(const QString url);
    void post(const QString url, const QByteArray &data);
    ~BasicHttpAPI();
protected:
    virtual void requestFinished(QNetworkReply *reply, const QByteArray data, const int statusCode) = 0;


signals:

public slots:
    void serviceRequestFinished(QNetworkReply *reply);

private:
    QNetworkRequest httpRequest;
    QNetworkAccessManager networkAccessManager;
    QSettings *settings;

};

#endif // BASICHTTPAPI_H
